import React,{Component}  from 'react'
import moment from 'moment'
import {Table,Pagination,Card} from 'antd';

const Tablelist = ({scroll,data,page,columns,onShowSizeChange,onChangecurrentpage,onSorterChange,record})=>{
	console.log('data',data,'page',page,scroll)
	const TableInfo ={
		dataTable:{
			columns:columns,
			dataSource:data,
		},
		pageInfo:{
			current:page.currentpage,
			pageSize:page.pagesize,
			total:page.totalnum,
			onShowSizeChange:onShowSizeChange,
			onChange:onChangecurrentpage,
			pageSizeOptions:['15', '25', '35', '45']
		}
	}
	return(
		<Card>
			<Table
				{...TableInfo.dataTable}
				pagination={false}
				rowKey={record}
				onChange={onSorterChange}
				scroll={scroll}
			/>
			<Pagination
				{...TableInfo.pageInfo}
				showSizeChanger
				showTotal={total => `共 ${total} 条记录`}
			/>
		</Card>
	)
}
export default Tablelist
